/**
 * @(#)MainPagerAdapter.java, 2014年10月11日. Copyright 2012 Yodao, Inc.
 * All rights reserved. YODAO
 * PROPRIETARY/CONFIDENTIAL. Use is subject
 * to license terms.
 */
package com.scitc.pleasurevideo.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;

import java.util.List;

/**
 * @author lukun
 *
 */
public class MainPagerAdapter extends FragmentStatePagerAdapter implements
        ViewPager.OnPageChangeListener {

    private List<Fragment> mFragments;

    public MainPagerAdapter(FragmentManager fm, List<Fragment> fs) {
        super(fm);
        mFragments = fs;
    }

    @Override
    public Fragment getItem(int position) {
        if (position >= mFragments.size()) {
            return null;
        } else {
            return mFragments.get(position);
        }
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public void onPageScrollStateChanged(int arg0) {

    }

    @Override
    public void onPageScrolled(int arg0, float arg1, int arg2) {

    }

    @Override
    public void onPageSelected(int arg0) {

    }

}
